import 'package:hotpot/generated/json/base/json_convert_content.dart';
import 'package:hotpot/models/res_country.dart';

ResCountry $ResCountryFromJson(Map<String, dynamic> json) {
	final ResCountry resCountry = ResCountry();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		resCountry.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		resCountry.name = name;
	}
	final String? code = jsonConvert.convert<String>(json['code']);
	if (code != null) {
		resCountry.code = code;
	}
	final String? addressFormat = jsonConvert.convert<String>(json['address_format']);
	if (addressFormat != null) {
		resCountry.addressFormat = addressFormat;
	}
	final bool? addressViewId = jsonConvert.convert<bool>(json['address_view_id']);
	if (addressViewId != null) {
		resCountry.addressViewId = addressViewId;
	}
	final List<String>? currencyId = jsonConvert.convertListNotNull<String>(json['currency_id']);
	if (currencyId != null) {
		resCountry.currencyId = currencyId;
	}
	final String? imageUrl = jsonConvert.convert<String>(json['image_url']);
	if (imageUrl != null) {
		resCountry.imageUrl = imageUrl;
	}
	final int? phoneCode = jsonConvert.convert<int>(json['phone_code']);
	if (phoneCode != null) {
		resCountry.phoneCode = phoneCode;
	}
	final List<String>? countryGroupIds = jsonConvert.convertListNotNull<String>(json['country_group_ids']);
	if (countryGroupIds != null) {
		resCountry.countryGroupIds = countryGroupIds;
	}
	final List<String>? stateIds = jsonConvert.convertListNotNull<String>(json['state_ids']);
	if (stateIds != null) {
		resCountry.stateIds = stateIds;
	}
	final String? namePosition = jsonConvert.convert<String>(json['name_position']);
	if (namePosition != null) {
		resCountry.namePosition = namePosition;
	}
	final bool? vatLabel = jsonConvert.convert<bool>(json['vat_label']);
	if (vatLabel != null) {
		resCountry.vatLabel = vatLabel;
	}
	final bool? stateRequired = jsonConvert.convert<bool>(json['state_required']);
	if (stateRequired != null) {
		resCountry.stateRequired = stateRequired;
	}
	final bool? zipRequired = jsonConvert.convert<bool>(json['zip_required']);
	if (zipRequired != null) {
		resCountry.zipRequired = zipRequired;
	}
	final String? sLastUpdate = jsonConvert.convert<String>(json['__last_update']);
	if (sLastUpdate != null) {
		resCountry.sLastUpdate = sLastUpdate;
	}
	final String? displayName = jsonConvert.convert<String>(json['display_name']);
	if (displayName != null) {
		resCountry.displayName = displayName;
	}
	final List<String>? createUid = jsonConvert.convertListNotNull<String>(json['create_uid']);
	if (createUid != null) {
		resCountry.createUid = createUid;
	}
	final String? createDate = jsonConvert.convert<String>(json['create_date']);
	if (createDate != null) {
		resCountry.createDate = createDate;
	}
	final List<String>? writeUid = jsonConvert.convertListNotNull<String>(json['write_uid']);
	if (writeUid != null) {
		resCountry.writeUid = writeUid;
	}
	final String? writeDate = jsonConvert.convert<String>(json['write_date']);
	if (writeDate != null) {
		resCountry.writeDate = writeDate;
	}
	return resCountry;
}

Map<String, dynamic> $ResCountryToJson(ResCountry entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['code'] = entity.code;
	data['address_format'] = entity.addressFormat;
	data['address_view_id'] = entity.addressViewId;
	data['currency_id'] =  entity.currencyId;
	data['image_url'] = entity.imageUrl;
	data['phone_code'] = entity.phoneCode;
	data['country_group_ids'] =  entity.countryGroupIds;
	data['state_ids'] =  entity.stateIds;
	data['name_position'] = entity.namePosition;
	data['vat_label'] = entity.vatLabel;
	data['state_required'] = entity.stateRequired;
	data['zip_required'] = entity.zipRequired;
	data['__last_update'] = entity.sLastUpdate;
	data['display_name'] = entity.displayName;
	data['create_uid'] =  entity.createUid;
	data['create_date'] = entity.createDate;
	data['write_uid'] =  entity.writeUid;
	data['write_date'] = entity.writeDate;
	return data;
}